<h3>TIN NHẮN (<?php echo count($arrMess)?>)</h3>
<?php
	global $ubi;
	
	$start = $page * $ubi['SITE']['NUMBER_MESSAGE'];
	$end = min($start + $ubi['SITE']['NUMBER_MESSAGE'], count($arrMess));
		
	for ($i = $start; $i < $end; $i++) {
		$mess = $arrMess[$i];	
		$u = $arrUser[$mess->getSenderID()];
		$img = $imgs[$mess->getSenderID()];		
?>
		<div id="mess<?php echo $mess->getMessageID()?>" class="mess <?php if ($mess->isRead()) { echo "read"; }?>">
			<div class="comment">
			    <div style="text-align:center">	    		
			        <a href="#">
				        <img src="<?php echo $ubi['SERVER']['THUMBNAIL_PATH']?>/<?php echo $img?>" class="smallAvatar" /><br />	            	
			        </a>                                    
			        <a href="index.php?view&type=user&userid=<?php echo $u->getUserID();?>"><?php echo $u->getUserName();?></a>
				</div>							
			</div>
			    
			<div class="right">
				<div style="float:left">					
				    <div class="date" style="float:left">
				    	<?php echo date('d/m/Y H:i:s', $mess->getCreatedDate()) ?>
				    </div>				
				</div>    
			    <div class="comment_icons">
					<a class="a_cursor" title="Đánh dấu đã đọc" 
		        		onclick="$.readMessage('<?php echo $mess->getMessageID()?>')">
		        			<img src="include/imgs/circle-check.png" />
		        	</a>
					<a class="a_cursor" title="Xóa tin nhắn"
		        		onclick="$.deleteMessage('<?php echo $mess->getMessageID()?>')">
		        			<img src="include/imgs/circle-delete.png" />
		        	</a>		        	
				</div>
				<div style="clear:both"></div>
				<div><b><?php echo $mess->getTitle()?></b></div>    
				<p><?php echo $mess->getContent()?></p>
								
				<div style="clear:both"></div>
			</div>
			<div style="clear:both"></div>
		</div>
<?php 
	} 
?>
Trang : <?php echo $getVars['page'] + 1?> / <?php echo $nPage?><br />

<?php
	if ($page > 0) { 
?>
<a id="pageFist">&lt;&lt;</a>&nbsp;
<a id="pagePrevious">&lt;</a>&nbsp;
<?php
	} 
?>

<?php
	if ($page < $nPage - 1) {
?>
		<a id="pageNext">&gt;</a>&nbsp;
		<a id="pageLast">&gt;&gt;</a>
<?php 
	} 
?>  

<script language="javascript">
	$('#pageFirst').click(function() {
		$('#userMessage').load("index.php?message&type=allMessages&page=0");
	});
	
	$('#pagePrevious').click(function() {
		$('#userMessage').load("index.php?message&type=allMessages&page=<?php echo $page - 1?>");
	});
	
	$('#pageNext').click(function() {
		$('#userMessage').load("index.php?message&type=allMessages&page=<?php echo $page + 1?>");
	});
	
	$('#pagePrevious').click(function() {
		$('#userMessage').load("index.php?message&type=allMessages&page=<?php echo $nPage - 1?>");
	});
</script>